public class HCF {
    public static void main(String[] args) {
        int a=20;
        int b=40;
        int c=a%b;
        while(c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println("最大公约数是:"+b);
    }


}
